package com.csust.automaticteach.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.csust.automaticteach.model.dto.exercisessets.ExercisesSetsQueryRequest;
import com.csust.automaticteach.model.entity.ExercisesSets;
import com.baomidou.mybatisplus.extension.service.IService;
import com.csust.automaticteach.model.entity.User;
import com.csust.automaticteach.model.vo.exercises.ExercisesVO;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
* @author 钰玟
* @description 针对表【t_exercises_sets(套题表)】的数据库操作Service
* @createDate 2025-07-23 20:16:17
*/
public interface ExercisesSetsService extends IService<ExercisesSets> {

    /**
     * 分页查询套题
     * @param exercisesSetsQueryRequest  查询条件
     * @param loginUser 登录用户
     * @return 查询结果
     */
    QueryWrapper<ExercisesSets> getQueryWrapper(ExercisesSetsQueryRequest exercisesSetsQueryRequest, User loginUser);

    /**
     * 分页查询套题
     *
     * @param exercisesSetsQueryRequest 查询条件
     * @param request                   请求
     * @return
     */
    Page<ExercisesSets> listExercisesSetByPage(@RequestBody ExercisesSetsQueryRequest exercisesSetsQueryRequest
            , HttpServletRequest request);

    /**
     * 根据套题id查询套题下的所有题目
     *
     * @param setId 套题id
     * @return 查询结果
     */
    List<ExercisesVO> getExerciseVOList(Long setId);

    /**
     * 删除套题 及其下的题目
     *
     * @param setId 套题id
     * @return 删除结果
     */
    Boolean deleteExercisesSet(Long setId);
}
